
****************
*** Fig. A.2 ***
****************

* load frame
frame change italian_data

* n. associazioni, GVA change
reg mainstream i.worse_econ##c.associations##i.declining_gva i.education age i.male i.election_year i.provincen, vce(cluster province)

margins declining_gva, dydx(worse_econ) at(associations=(0(4)16))
mplotoffset,  offset(0.5) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Increasing GVA" 4 "Declining GVA"))
graph addplot histogram associations, ///
	yaxis(2) ///
	yscale(range(0 1) off axis(2)) ///
	xlabel(0(4)24) ///
	color(black%10) ///
	legend( ///
		region(lwidth(none)) ///
		col(2) ///
		position(6) ///
		order(3 "Increasing GVA" 4 "Declining GVA"))
graph export "$folder/replication/figures/figA2a.pdf", replace
	
* n. associazioni, GVA change tercile
reg mainstream i.worse_econ##c.associations##i.gva_tercile i.education age i.male i.election_year i.regionen, vce(cluster province)

margins gva_tercile, dydx(worse_econ) at(associations=(0(4)16))
mplotoffset,  offset(0.5) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of associations", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(blue) lcolor(blue) lwidth(medthick)) ci1opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(red) lp(solid)  mlcolor(red) lcolor(red) lwidth(medthick)) ci3opts(lcolor(red)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low GVA change" 5 "Mid GVA change" 6 "High GVA change"))
graph addplot histogram associations, ///
	yaxis(2) ///
	yscale(range(0 1) off axis(2)) ///
	xlabel(0(4)24) ///
	color(black%10) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low GVA change" 5 "Mid GVA change" 6 "High GVA change"))
graph export "$folder/replication/figures/figA2b.pdf", replace
	

* n. coni association, GVA change

reg mainstream i.worse_econ##c.coni_assoc_1999##i.declining_gva i.education age i.male c.population_2001 i.election_year i.regionen, vce(cluster regionen)

margins declining_gva, dydx(worse_econ) at(coni_assoc_1999=(0.5(.4)2.1))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(red) lcolor(red) lwidth(medthick)) ci1opts(lcolor(red)) ///
        plot2opts(msymbol(O) msize(medium) mcolor(blue) lp(solid)  mlcolor(blue) lcolor(blue) lwidth(medthick)) ci2opts(lcolor(blue)) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Increasing GVA" 4 "Declining GVA"))
graph addplot histogram coni_assoc_1999, ///
	yaxis(2) ///
	yscale(range(0 10) off axis(2)) ///
	xlabel(0.1(0.4)2.5) ///
	color(black%10) ///
		legend( ///
			region(lwidth(none)) ///
			col(2) ///
			position(6) ///
			order(3 "Increasing GVA" 4 "Declining GVA"))
graph export "$folder/replication/figures/figA2c.pdf", replace

* n. coni association, GVA change tercile

reg mainstream i.worse_econ##c.coni_assoc_1999##i.gva_tercile i.education age i.male c.population_2001 i.election_year i.regionen, vce(cluster regionen)

margins gva_tercile, dydx(worse_econ) at(coni_assoc_1999=(0.5(.4)2.1))
mplotoffset,  offset(0.05) recast(scatter) ///
		title("") ///
		ytitle("Mainstream vote", size(large)) ///
		xtitle("Number of sports clubs", size(large)) ///		
		yline(0, lw(thin) lstyle(foreground) ) ///
		ylabel(, grid glcolor(black%70) glw(thin) labs(medl)) ///
		xlabel(, nogrid) ///
		aspect(1) ///
		plot1opts(msymbol(D) msize(medium) mcolor(blue) lcolor(blue) lwidth(medthick)) ci1opts(lcolor(blue)) ///
        plot2opts(msymbol(T) msize(medium) mcolor(orange) lp(solid)  mlcolor(orange) lcolor(orange) lwidth(medthick)) ci2opts(lcolor(orange)) ///
        plot3opts(msymbol(O) msize(medium) mcolor(red) lp(solid)  mlcolor(red) lcolor(red) lwidth(medthick)) ci3opts(lcolor(red)) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
			order(4 "Low GVA change" 5 "Mid GVA change" 6 "High GVA change"))
graph addplot histogram coni_assoc_1999, ///
	yaxis(2) ///
	yscale(range(0 10) off axis(2)) ///
	xlabel(0.1(0.4)2.5) ///
	color(black%10) ///
		legend( ///
			region(lwidth(none)) ///
			col(3) ///
			position(6) ///
order(4 "Low GVA change" 5 "Mid GVA change" 6 "High GVA change"))
graph export "$folder/replication/figures/figA2d.pdf", replace

